package net.xiduth.game.npc.combat.impl;

import java.util.ArrayList;

import net.xiduth.game.Animation;
import net.xiduth.game.Entity;
import net.xiduth.game.Hit;
import net.xiduth.game.World;
import net.xiduth.game.npc.NPC;
import net.xiduth.game.npc.combat.CombatScript;
import net.xiduth.game.npc.combat.NPCCombatDefinitions;
import net.xiduth.utils.Misc;

/**
 * 
 * @author Jae <jae@xiduth.com>
 * 
 * @since <Oct 18, 2013>
 *
 */
public class DagPrime extends CombatScript {

	public Object[] getKeys() {
		return new Object[] { "Dagannoth Prime" };
	}

	public int attack(NPC npc, Entity target) {
		NPCCombatDefinitions defs = npc.getCombatDefinitions();
		int damage = 610 - Misc.random(250);
		npc.setNextAnimation(new Animation(2855));
		final ArrayList<Entity> possibleTargets = npc.getPossibleTargets();
		for (Entity t : possibleTargets) {
			delayHit(npc, 0, t, new Hit[] { getMagicHit(npc, damage) });
			World.sendProjectile(npc, t, 2707, 34, 16, 30, 35, 16, 0);
		}
		return defs.getAttackDelay();
	}
}
